/*
 * Sink.cc
 *
 *  Created on: 2011-5-16
 *      Author: RenJu
 */

#include <omnetpp.h>
#include "Node.h"

namespace wsn{


class Sink:public cSimpleModule
{
protected:
	void virtual initialize();
	void virtual handleMessage(cMessage* msg);
};

Define_Module(Sink);

void Sink::initialize()
{
	cModule* parent = this->getParentModule();
	this->setGateSize("in",parent->par("node_num"));
}


void Sink::handleMessage(cMessage* msg)
{
    bubble("Sink has received~!");
    delete msg;
}
}  //namespace wsn
